using Contact = TestingMvvm.Models.Contact;

namespace TestingMvvm.Services;

public class ContactStorage : IContactStorage {
    private readonly IIdGenerator _idGenerator;

    public ContactStorage(IIdGenerator idGenerator) {
        _idGenerator = idGenerator ??
            throw new ArgumentNullException(
                nameof(idGenerator));
    }

    public IEnumerable<Contact> List() =>
        Enumerable.Range(0, 10)
            .Select(_ => _idGenerator.Generate())
            .Select(p =>
            new Contact {
                Id = p, 
                Name = "Name " + p, 
                PhoneNumber = "Phone Number " + p
            });
}